package heap;

public class HeapElement implements Comparable<HeapElement> {

	private int chave;
	private String satelliteData;
	
	public HeapElement(int chave) {
		this.chave = chave;
		this.satelliteData = "Satellite data of key " + chave;
	}
	@Override
	public String toString(){
		return this.chave + "";
	}

	@Override
	public int compareTo(HeapElement obj) {
		int resp = 0;
		if(this.chave < obj.getChave()){
			resp = -1;
		}else if(this.chave > obj.getChave()){
			resp = 1;
		}
		return resp;
	}

	@Override
	public boolean equals(Object obj) {
		boolean resp = false;
		if(obj instanceof HeapElement){
			resp = (this.chave == ((HeapElement) obj).getChave());
		}
		return resp;
	}

	public int getChave() {
		return chave;
	}

	public void setChave(int chave) {
		this.chave = chave;
	}

	public String getSatelliteData() {
		return satelliteData;
	}

	public void setSatelliteData(String satelliteData) {
		this.satelliteData = satelliteData;
	}

}
